﻿using Neonode.Forms;
using System;
using System.ComponentModel;
using System.Reflection;

namespace StopWatch
{
    class FrmMenu : Menu
    {
        public FrmMenu()
        {
            InitializeComponent();
        }

        private void InitializeComponent()
        {
            ImageList imgList = new ImageList();
            imgList.Images.Add(base.GetType().Assembly, "StopWatch.Properties.Resources.resources", "Settings");
            imgList.Images.Add(base.GetType().Assembly, "StopWatch.Properties.Resources.resources", "About");
            ImageList = imgList;
            MenuPage menuPage = new MenuPage();
            menuPage.Buttons[0].Text = "Settings";
            menuPage.Buttons[0].ImageIndex = 0;
            menuPage.Buttons[0].Enabled = true;
            menuPage.Buttons[0].Click += new System.ComponentModel.CancelEventHandler(this.frmMainSettings_Click);
            menuPage.Buttons[1].Text = "About";
            menuPage.Buttons[1].ImageIndex = 1;
            menuPage.Buttons[1].Enabled = true;
            menuPage.Buttons[1].Click += new System.ComponentModel.CancelEventHandler(this.frmMainAbout_Click);
            TabPages.Add(menuPage);
        }
        
        private void frmMainAbout_Click(object sender, CancelEventArgs e)
        {
            MessageBox.Show(this.Handle, "Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString() + "\r\n\r\n2008 Herbie", "About StopWatch");
        }

        private void frmMainSettings_Click(object sender, CancelEventArgs e)
        {
            new FrmSettings().ShowDialog();
        }
    }
}
